#ifndef _PROFILERWIDGET_H_
#define _PROFILERWIDGET_H_
#include <SEUi/Widget/Widget.h>
#include <SECore/Timer.h>
#include <SECore/Signal.h>
#include <SERender/Entity/Camera.h>

namespace SEngine
{

    constexpr int TIME_RECORD_COUNT = 100;

    class EditLayer;
    class ProfilerWidget : public Widget
    {
    public:
        ProfilerWidget(EditLayer &);
        virtual ~ProfilerWidget() = default;

        void OnCameraUpdate(Camera& camera);
        void OnCameraSpeedUpdate(float speed);

    protected:
        virtual void BeginUpdate() override {}
        virtual void UpdateImpl(int delta) override;
        virtual void EndUpdate() override {}

    // public:
    //     Signal<Camera*>     SignalSyncCamera;
    //     Signal<float&>      SignalSyncCameraSpeed;

    private:
        Signal<>            SignalUpdateGUI;

    private:
        EditLayer & m_layer;
        Timer m_timer;
        // int m_delta;
        float m_fpsRecord[TIME_RECORD_COUNT]{0.0f};
        int m_curFpsOffset{0};
    };
} // namespace SEngine


#endif